package hk.edu.polyu.comp.motioncapture;

public class FPS extends Thread {
	private int prevFramecount = 0;
	private int afterFramecount = 0;
	private int fps = 0;
	private CameraControl cc;

	public FPS(CameraControl cc) {
		this.cc = cc;
		prevFramecount = cc.getPlayer().size();
	}

	public void run() {
		try {
			while (true) {
				afterFramecount = cc.getPlayer().size();
				fps = afterFramecount - prevFramecount;

				prevFramecount = afterFramecount;

				Thread.sleep(1000);
			}
		} catch (Exception exc) {

		}

	}

	public int getFPS() {
		return fps;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {

	}

}
